
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@page import="com.wed.db.ConnectDB"%>
<%@page import="com.wed.db.RalationConcept"%>
<%@page import="java.util.ArrayList"%>
<!DOCTYPE html >
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Tests concept map</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/stile.css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.2.js">
	
</script>
<script type="text/javascript">
	function contentDisp() {
		$.ajax({
			url : "includetxt.jsp",
			success : function(data) {
				$("#concepts").html(data);
			}
		});
	}
</script> 
<link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/datepicker.css" rel="stylesheet" />

	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/datepickr.css" />
<script src="${pageContext.request.contextPath}/js/bootstrap-datepicker.js"></script>
</head>
<body>
<%int idVe=Integer.parseInt(request.getParameter("idVersion")); 
int asi=Integer.parseInt(request.getParameter("AssignmentId")); 
String user=request.getParameter("username");
ArrayList<RalationConcept> r = new ConnectDB().getConceptByID(idVe);

%>
<form action="SubmitServlet" method="get">

 <div id="container"></div>
<div><textarea id="concepts" name="Concept" rows="10" cols="60" >
Cach Ve: concept1-relation-concept2
Concept:
         <%
				 for(RalationConcept h : r){				 
				%>
<%=h.getConcept1() %>"<%=h.getRelation() %>"<%=h.getConcept2() %>
<%} %>
</textarea></div>
		
		<div>
		<table  width="399"  align="center" >
			<tr>
				<th colspan="2" scope="col">Vẽ Concept Map</th>
			</tr>
			
			
			<tr>
				<td width="131">Username</td>
				<td width="225"><label for="Description"></label>
					<input
					type="text" name="username" id="username" value="<%=user %>"
					readonly="readonly"/></td>
			</tr>
			<tr>
				<td width="131">VersionId</td>
				<td width="225"><label for="Description"></label>
					<input
					type="text" name="idVersion" id="idVersion" value="<%=idVe %>"
					readonly="readonly"/></td>
			</tr>
		<tr>
				<td width="131">AssignmentId</td>
				<td width="225"><label for="Description"></label>
					<input
					type="text" name="AssignmentId" id="AssignmentId" value="<%=asi %>"
					readonly="readonly"/></td>
			</tr>
			<tr>
				
				<td width="225"><input type="submit" value="Nộp Bài" onClick="contentDisp();"
		style="color: blue; height: 36px; width: 94px"  >	
		
			</tr>
			
			
		</table>		
		</div>				
</form>

</body>
<! goi ten lop js de ve>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.conceptmap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/textareaLoader.js"></script>
<script type="text/javascript">
$(function() {
  $("#container").conceptMap({'tripleLoader': {func: textareaLoadEngine, args: {}}});
});
</script>
</html>
